package org.wiztools.thegreatwall;

import java.util.regex.Pattern;

/**
 *
 * @author arun
 */
public class Validator {

    private static final Pattern NAME = Pattern.compile("[a-zA-Z]++");
    private static final Pattern EMAIL = Pattern.compile(
            "^[\\w\\-]([\\.\\w])+[\\w]+@([\\w\\-]+\\.)+[A-Z]{2,4}$",
            Pattern.CASE_INSENSITIVE);

    public static boolean validName(final String name) {
        return NAME.matcher(name).matches();
    }

    public static boolean validEmail(final String email) {
        return EMAIL.matcher(email).matches();

    }
}
